﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using KeRui.Common;

public partial class Manage_Main : System.Web.UI.Page
{
    public string mainUrl = Utils.UrlDecode(PageRequest.GetString("url"));
    public string menuUrl = Utils.UrlDecode(PageRequest.GetString("menu"));
    public string topUrl = "";


    public int SiteID = PageRequest.GetInt("siteid", -1);
    public int SiteMenu = PageRequest.GetInt("sitemenu", -1);


    protected void Page_Load(object sender, EventArgs e)
    {
        ManageHelper.CheckAdminLogin("frame");

        KeRui.Model.CmsSite modelSite;

        if (SiteID > 0)
        {
            KeRui.BLL.CmsSite bllSite = new KeRui.BLL.CmsSite();
            modelSite = bllSite.GetModel(SiteID);
            if (modelSite == null)
                SiteID = -1;
        }

        if (mainUrl.Length > 7 && mainUrl.Substring(0, 7) == "http://")
            mainUrl = "";
        if (mainUrl == "")
            mainUrl = "welcome.aspx?siteid=" + SiteID;

        if (menuUrl.Length > 7 && menuUrl.Substring(0, 7) == "http://")
            menuUrl = "";

        if (menuUrl == "")
        {
            if(SiteID>0)
                menuUrl = "menu.aspx?siteid=" + SiteID + "&act=contentmanage&actname=信息管理";
            else if (SiteMenu > 0)
                menuUrl = "menu.aspx?siteid=" + SiteMenu + "&act=&actname=" + PageRequest.GetString("actname").Trim();
            else
                menuUrl = "menu.aspx?siteid=" + SiteID + "&actname=站点管理";
        }

        if(topUrl=="")
            topUrl = "top.aspx?siteid=" + SiteID;

    }
}
